﻿CREATE TRIGGER [dbo].[tr_CarInfo_BookValues_Reset]
ON [dbo].[t_CarInfo] 
FOR INSERT, UPDATE
AS


IF UPDATE (VIN) OR UPDATE(Mileage)

DELETE   t_CarInfo_BookValues
FROM         t_CarInfo_BookValues INNER JOIN
                      inserted t_CarInfo ON t_CarInfo_BookValues.VIN = t_CarInfo.VIN
